package com.ccnu.JobHub.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ccnu.JobHub.mapper.ViewPostMapper;
import com.ccnu.JobHub.model.database.ViewPost;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ViewPostService extends ServiceImpl<ViewPostMapper, ViewPost> {

    private final ViewPostMapper viewPostMapper;

    public ViewPostService(ViewPostMapper viewPostMapper) {
        this.viewPostMapper = viewPostMapper;
    }

    /**
     * 搜索升学贴
     * @param search 搜索内容
     * @param page 当前页码
     * @param pageSize 页面大小
     * @return 一个list
     */
    public List<ViewPost> searchEnrollmentPost(String search, Integer page, Integer pageSize) {
        return viewPostMapper.searchEnrollmentPost(search, page, pageSize);
    }

    /**
     * 搜索就业贴
     * @param search 搜索内容
     * @param page 当前页码
     * @param pageSize 页面大小
     * @return 一个list
     */
    public List<ViewPost> searchJobPost(String search, Integer page, Integer pageSize) {
        return viewPostMapper.searchJobPost(search, page, pageSize);
    }
}
